<!DOCTYPE html>
<html>
<head>
	<title>信息公告 - 胎大王</title>
	<meta charset="UTF-8">
	{include file='common/head' /}
	<script src="__JS__/echarts.min.js"></script>
<style type="text/css">   
td {height: 28px;};  
</style> 
</head>
<body>
<div class="container">
{include file='common/top' /}
	<div class="f-bk10"></div>
	<div class="publish-banner"></div>
	<div class="f-bk50"></div>
	<div class="publish-main">
		<div class="contai">
			<div class="publish-tit">
				<strong> 订单发布实时公告</strong>
				<div class="more">TDW NEWS INFOTMATION</div>
			</div>
			<div class="f-bk15"></div>
			{if condition="$data.code==1"}
			{volist name="$data['data']['array']" id="vo"}
			<div class="publish-list">
				<div class="pure-g">
					<div class="pure-u-2-24">
						<div class="publish-left">
							<div>
								订单<br>
								预告
							</div>
						</div>
					</div>
					<div class="pure-u-20-24">
						<div class="publish-right">
							{if condition="$vo.orderTypes=='bonus'"}
							<div>
								{if condition="$vo.enable==1"}
								<a href="/dividend.html"><strong>分红式抢购订单</strong></a>
								{else /}
								<strong>分红式抢购订单</strong>
								{/if}
								<p>
									尊敬的客户您好：<span>胎大王将于{$vo.startDate|substr=0,10} 10点整发布分红式抢购订单，订单池抢完为止，请及时关注分红式订单池，以免错过订单抢购日期；</span>
								</p>
								<p>
									注：单笔订单最低购买数量为20条。
								</p>
							</div>
							{elseif condition="$vo.orderTypes=='deposit'" /}
							<div>
								{if condition="$vo.enable==1"}
								<a href="/deposit.html"><strong>即时抢购订单</strong></a>
								{else /}
								<strong>即时抢购订单</strong>
								{/if}
								<p>
									尊敬的客户您好：<span>胎大王将于{$vo.startDate|substr=0,10} 10点整发布即时抢购订单，订单池抢完为止，请及时关注订单池，以免错过订单抢购日期；</span>
								</p>
								<p>
									注：单笔订单最低购买数量为20条。
								</p>
							</div>							
							{else /}
							{/if}
						</div>
					</div>
				</div>
				<input type="hidden" id="{$vo.orderTypes}-totalQuantity" value="{$vo.totalQuantity}" />
				<input type="hidden" id="{$vo.orderTypes}-remainderQuantity" value="{$vo.remainderQuantity}" />
			</div>
			{/volist}
			{else /}
			<div class="publish-list">
				<div class="pure-g">
					<div class="pure-u-2-24">
						<div class="publish-left">
							<div>
								订单<br>
								预告
							</div>
						</div>
					</div>
					<div class="pure-u-20-24">
						<div class="publish-right">
							<div>
								<strong>分红式抢购订单</strong>
								<p>
									尊敬的客户您好：<span>当前暂无可抢购订单，请及时关注订单池，以免错过订单抢购日期；</span>
								</p>
								<p>
									注：单笔订单最低购买数量为20条。
								</p>
							</div>
						</div>
					</div>
				</div>
				<input type="hidden" id="bonus-totalQuantity" value="0" />
				<input type="hidden" id="bonus-remainderQuantity" value="0" />
			</div>
			<div class="publish-list">
				<div class="pure-g">
					<div class="pure-u-2-24">
						<div class="publish-left">
							<div>
								订单<br>
								预告
							</div>
						</div>
					</div>
					<div class="pure-u-20-24">
						<div class="publish-right">
							<div>
								<strong>即时抢购订单</strong>
								<p>
									尊敬的客户您好：<span>当前暂无可抢购订单，请及时关注订单池，以免错过订单抢购日期；</span>
								</p>
								<p>
									注：单笔订单最低购买数量为20条。
								</p>
							</div>	
						</div>
					</div>
				</div>
				<input type="hidden" id="deposit-totalQuantity" value="0" />
				<input type="hidden" id="deposit-remainderQuantity" value="0" />
			</div>			
			{/if}
			<div class="pure-g">
				<div class="pure-u-1-1">
					<div id="chart1" style="width: 100%;height:500px;"></div>
				</div>
			</div>
			<div id="demo3" class="publish-tit2">
				<strong> 订单抢购列表</strong>
				<div class="more">TDW NEWS INFOTMATION</div>
			</div>
			{if condition="$data2.code==1"}
			<div id="demo" style="overflow: hidden; height: 200px;">
				<div id="demo1">
					<table width="1100" border="0" align="center" cellpadding="0" cellspacing="0" class="publish-table">
					{volist name="$data2['data']['orderDatas']" id="v"}
						<tr>	
							<td>{$v.sn}</td>
							<td>{$v.consignee}</td>
							<td>{$v.phone}</td>
							<td>{$v.quantity}条</td>
							<td>{$v.orderType}</td>
							<td>已付款</td>
							<td>订单交易完成</td>
						</tr>
					{/volist}						
					</table>
				</div>
				<div id="demo2"></div>
			</div>
			{else /}
			  <div style="text-align:center;padding: 5rem 0;">
				<img src="__IMG__/success.png">
				<p style="color: #ec6c00;">暂无订单</p>
			  </div>
			{/if}
		</div>
	</div>
	<div class="f-bk50"></div>
	{include file='common/foot' /}	
</div>
{include file='common/back' /}
<script>
    var myChart1 = echarts.init(document.getElementById('chart1'));
	var bonustotal = $("#bonus-totalQuantity").val();
	var bonusremainder = $("#bonus-remainderQuantity").val();
	var deposittotal = $("#deposit-totalQuantity").val();
	var depositremainder = $("#deposit-remainderQuantity").val();
	var bonus1=0;
	var bonus2=0;
	var deposit1=0;
	var deposit2=0;
	if(bonustotal==''||bonustotal==undefined||bonustotal==null||bonusremainder==''||bonusremainder==undefined||bonusremainder==null){
		
	}else{
		bonus1=parseInt(bonusremainder);
		bonus2= parseInt(bonustotal)-parseInt(bonusremainder);
	}
	if(deposittotal==''||deposittotal==undefined||deposittotal==null||depositremainder==''||depositremainder==undefined||depositremainder==null){
		
	}else{
		deposit1=parseInt(depositremainder);
		deposit2= parseInt(deposittotal)-parseInt(depositremainder);
	}
    option = {
    backgroundColor:'#fff',
    
    tooltip: {
    },
    
    series: [{
        name: '分红式抢购订单',
        type: 'pie',
        radius: ['30%', '50%'],
        center:['25%','45%'],
        color:'#FF4500',
        label: {
            normal: {
                position: 'center'
            }
        },
        data: [{
            value: bonus1,
            name: '剩余数量',
            label: {
                normal: {
                    formatter: '{d} %',
                    textStyle: {
                        fontSize: 18
                    }
                }
            }
        }, {
            value: bonus2,
            name: '已抢购数量',
            label: {
                normal: {
                    formatter: '\n分红式抢购订单',
                    textStyle: {
                        color: '#555',
                        fontSize: 13
                    }
                }
            },
            itemStyle: {
                normal: {
                    color: '#aaa'
                },
                emphasis: {
                    color: '#aaa'
                }
            },
        }]
    },{
        name: '即时抢购订单',
        type: 'pie',
        radius: ['30%', '50%'],
        center:['70%','45%'],
        color:'#00cccb',
        label: {
            normal: {
                position: 'center'
            }
        },
        data: [{
            value: deposit1,
            name: '剩余数',
            
            label: {
                normal: {
                    formatter: '{d} %',
                    textStyle: {
                        fontSize: 18
                    }
                }
            }
        }, {
            value: deposit2,
            name: '已抢购数',
            label: {
                normal: {
                    formatter: '\n即时抢购订单',
                    textStyle: {
                        color: '#555',
                        fontSize: 13
                    }
                }
            },
            itemStyle: {
                normal: {
                    color: '#aaa'
                },
                emphasis: {
                    color: '#aaa'
                }
            },
        }]
    }]
};

    myChart1.setOption(option);
</script>
<script type="text/javascript">  
var speed = 20;  
demo2.innerHTML = demo1.innerHTML;
var count = $("#demo1 table").find('tr').length;
if(count>5){
	function Marquee() { 
		var i = demo2.offsetTop-1460;
		if (i - demo.scrollTop <= 0) {  
			demo.scrollTop -= demo1.offsetHeight; 
		} else {  
			demo.scrollTop++;  
		}   
	}  
	var MyMar = setInterval(Marquee, speed); 
}else{
	$("#demo2").hide();
}
 
</script>
</body>
</html>